import React from 'react';
import BoardCol from './BoardCol'
import PropTypes from 'prop-types';

export default class BoardRow extends React.Component{
    static propTypes = {
        onColClick: PropTypes.func
    };

    handleColClick(row, col){
        this.props.onColClick(row, col);
    }

    render() {
        const {cols} = this.props;

        return (
             <div className="BoardRow-box">
                 {
                     cols.map((item,index)=>{
                         return <BoardCol onColClick={this.handleColClick.bind(this)} value={item} row={this.props.row} col={index} key={index} />
                     })
                 }
             </div>
        );
    }
}
